import { _decorator, Component, Label, AudioClip } from 'cc';
const { ccclass, property } = _decorator;
import { GameManager, GameStatus } from './GameManager';

@ccclass('GamePlayUI')
export class GamePlayUI extends Component {
  @property({ type: Label })
  labelComponent: Label
  start() {
    this.controlActive()
  }
  onDestroy() {
  }
  update(deltaTime: number) {
    this.labelComponent.string = String(GameManager.Score)
  }
  showGamePlayUI() {
    this.node.active = true
  }
  hideGamePlayUI() {
    this.node.active = false
  }
  controlActive() {
    if (GameManager.status === GameStatus.GamePlay) {
      this.showGamePlayUI()
    }
    else {
      this.hideGamePlayUI()
    }
  }
}


